20. 使用GDB的分析崩溃

一些有用的GDB命令:

help <command> - displays help

b <filename:linenumber> - breakpoint
disable b <breakpoint> - disable breakpoint
enable b <breakpoint> - enable breakpoint
info b - info on breakpoints

si - step one instruction
s - step till new source line

ni - next instruction (step over)
n - next line (step over)

r - run
c - continue

fi - execute till return

print <var> - prints value of variable
set <var> - change value of the variable

在GDB中打开imgRead_afl,用r选项提供崩溃文件路径,如下所示:

$ gdb ./imgRead_afl
(gdb) r out/crashes/id:000000,sig:06,src:000000,op:havoc,rep:128